﻿@model DateTime?

@if ( Model.HasValue ) {
   @Html.TextBox( "" , String.Format( "{0:dd/MM/yyyy}" , Model.Value ) , new  { @class = "datepicker",style="width:100px" } )
}
else {
   @Html.TextBox( "" , String.Format( "{0:dd/MM/yyyy}" , DateTime.Today ) , new { @class = "datepicker",style="width:100px" } )
}


<script type="text/javascript">
    $(document).ready(function () {
        $(".datepicker").datepicker
            ({
                dateFormat: 'dd.mm.yy',
                showStatus: true,
                showWeeks: true,
                highlightWeek: true,
                numberOfMonths: 1,
                showAnim: "scale",
                showOptions: {
                    origin: ["bottom", "right"]
                }
            });
    });
</script>
